<style>
  .picImg {
    width: 40px;
    height: 40px;
  }
</style>
<template>
  <div class="app-container">
    <!--<div class="filter-container">
      <el-select v-model="listQuery.serviceID" placeholder="请选择权益服务商">
        <el-option
          v-for="item in options"
          :key="item.agentID"
          :label="item.agentName"
          :value="item.agentID">
        </el-option>
      </el-select>
      <el-button @click="getInput">查询</el-button>
    </div>-->
    <!--&lt;!&ndash; 查询和其他操作 &ndash;&gt;-->
    <el-table v-loading="listLoading" :data="list" element-loading-text="正在查询中。。。" border fit highlight-current-row
              :header-cell-style="{background:'#92D3FF',color:'#fff'}">

      <el-table-column align="center" min-width="100" label="小权益服务商名称" prop="serviceName"/>
      <el-table-column align="center" min-width="100" label="小权益服务商统一信息用代码" prop="unicode"/>
      <el-table-column align="center" min-width="100" label="保单总数" prop="billCount"/>
      <el-table-column align="center" min-width="100" label="保单总额 (元)" prop="billAmount"/>
      <el-table-column align="center" min-width="100" label="服务费用总额 (元)" prop="fee"/>
    </el-table>
    <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize"
                @pagination="getList"/>
  </div>
</template>

<script>
  import {doGet, doPost} from '@/api'
  import {cities} from '@/utils/base'
  import Pagination from '@/components/Pagination' // Secondary package based on el-pagination

  export default {
    name: 'bank',
    components: {Pagination},
    filters: {},
    data() {
      return {
        list: [],
        total: 0,
        listLoading: false,
        options:[],
        listQuery: {
          /*serviceID: '',*/
            pageNum: 1,
            pageSize: 20
        },
        editDialogVisible: false,
      }
    },
    created() {
      this.getList()
      doGet('corrsearch.html?op=list', {})
        .then(response => {
          this.options=response.rows
        })
        .catch(response => {

        })
    },
    methods: {
      getList() {
        this.listLoading = true
        doGet('servicesearch.html?op=list', this.listQuery).then(response => {
          this.list = response.rows
          this.total = response.data.totalcount
          this.listLoading = false
        }).catch(() => {
          this.list = []
          this.total = 0
          this.listLoading = false
        })
      },
      getInput() {
        if(!this.listQuery.serviceID){
          this.$message({
            message: '请选择权益服务商',
            type: 'warning'
          });
          return false
        }
        this.getList()
      }
    }
  }
</script>
